package dai.math

import dai.core.base.Utils
import org.joml.Quaternionf
import org.joml.Vector3f


fun main(){
//    val position = Vector3f(0f,1f,3f)
//    val camera = Camera(position)
//    camera.lookAt(Vector3f())

    val position = Vector3f(0f,1f,1f)
    val center = Vector3f()
    val dir = (center.clone() as Vector3f).sub(position)

    val fromDir = Vector3f(0f,0f,-1f)

    val p = Quaternionf().rotateTo(fromDir,dir)
    println(Utils.toDegress(p.angle()))
    println("x:${p.x},y:${p.y},z:${p.z},w:${p.w}")

}